function f = evaluate_constraint(chrom, nObj, nVar)
V=nVar;  
a=0.11;
f = [];
y1 = 0;
y2 = 0;
[num]=xlsread('data.xlsx');
subdata=[];
    data=[];
    for q=1:3
        for o=1:24
            subdata=[infsup(round(num(o,q)-num(o,q)*a),round(num(o,q)+num(o,q)*a))];
            data=[data,subdata];
        end
    end
    Pw8=data(1:24);                                                       
    Pph5=data(25:48);                                                     
    Pwa9=data(49:72);
    fuhe=[];
    bodong=[];
    for f=4:7
        for b=1:24
            bodong=randperm(200,20) + num(b,f);
            fuhe=[fuhe;bodong];
        end
    end
    fuhe=fuhe';
    elec=[];
    pe=[];
    ee=[];
    eel=[];
    for e=1:96
        elec=fuhe(:,e); 
        pe1 = fitdist(elec,'Normal');
        pe=[pe,pe1];
        ee=paramci(pe(e),'Alpha',0.05);
        eel=[eel,ee];
    end   
    Lw=[];Le=[];Lc=[];Lh=[];
    for l=1:2:48
        electricit=[infsup(eel(1,l),eel(2,l))];
        electricity = infsup(round(electricit.inf),round(electricit.sup));
        col=[infsup(eel(1,l+48),eel(2,l+48))];
        cold = infsup(round(col.inf),round(col.sup));                     
        ho=[infsup(eel(1,l+96),eel(2,l+96))];
        hot = infsup(round(ho.inf),round(ho.sup));                        
        wate=[infsup(eel(1,l+144),eel(2,l+144))];
        water = infsup(round(wate.inf),round(wate.sup));                  
        Le=[Le,electricity];
        Lc=[Lc,cold];
        Lh=[Lh,hot];
        Lw=[Lw,water];
    end
E_H=infsup(200-0.08*rand(1),200+0.08*rand(1));                             
w_h=infsup(0.6-0.08*rand(1),0.6+0.08*rand(1));                             
w_eb=infsup(0.9-0.08*rand(1),0.9+0.08*rand(1));                            
w_ec=infsup(0.8-0.08*rand(1),0.8+0.08*rand(1));                            
w_ac=infsup(1.2-0.08*rand(1),1.2+0.08*rand(1));                            
w_acw=infsup(0.2-0.08*rand(1),0.2+0.08*rand(1));                           
w_h_e=infsup(0.8-0.08*rand(1),0.8+0.08*rand(1));                           
w_du=infsup(0.8-0.08*rand(1),0.8+0.08*rand(1));                            
w_wshp=infsup(4-0.08*rand(1),4+0.08*rand(1));                              
w_wshp_w=infsup(0.2-0.08*rand(1),0.2+0.08*rand(1));                        
E_ele_tank=infsup(500,600);
Nw8=chrom(1:24);                                                           
Nph5=chrom(25:48);                                                         
Nwa9=chrom(49:72);
EB=chrom(73:96);                                                           
EC=chrom(97:120);                                                          
AC=chrom(121:144);                                                         
WSHP=chrom(145:168);                                                       
DU=chrom(169:192);                                                         
a=0.11;
 for t=1:24
    He=EB(t)*w_eb;                                                         
    Heb = infsup(round(He.inf),round(He.sup));                             
    Ce=EC(t)*w_ec;                                                         
    Cec = infsup(round(Ce.inf),round(Ce.sup));                             
    Ca=AC(t)*w_ac;                                                         
    Cac = infsup(round(Ca.inf),round(Ca.sup));                             
    Wa=AC(t)*w_acw;                                                        
    Wac = infsup(round(Wa.inf),round(Wa.sup));                             
    Hwsh=WSHP(t)*w_wshp;                                                   
    Hwshp = infsup(round(Hwsh.inf),round(Hwsh.sup));                       
    Wwsh=WSHP(t)*w_wshp_w;                                                 
    Wwshp = infsup(round(Wwsh.inf),round(Wwsh.sup));                       
    Wd=DU(t)*w_du;                                                         
    Wdu = infsup(round(Wd.inf),round(Wd.sup));                             
P_out(t) = Nw8(t)*Pw8(t)+Nph5(t)*Pph5(t)+Nwa9(t)*Pwa9(t);
P_tran(t) = DU(t)+WSHP(t)+EB(t)+EC(t);
P_cha(t) = P_out(t) - P_tran(t) - Le(t);
if compare([inf(P_cha(t)),sup(P_cha(t)),0,0],2) == [inf(P_cha(t)),sup(P_cha(t))]
    if compare([inf(P_cha(t)),sup(P_cha(t)),inf(E_ele_tank),sup(E_ele_tank)],2) == [inf(P_cha(t)),sup(P_cha(t))]
        P_ele = E_ele_tank;                                                
        P_waste = P_cha(t) - E_ele_tank;
        V_h(t) = (0.0224*P_ele)/(4*w_h*2);                                 
    else
        P_ele = P_cha(t);
        V_h(t) = (0.0224*P_ele)/(4*w_h*2);                                 
        P_waste = 0;
    end

    c_h = -Hwshp-Heb+AC(t)+Lh(t);

    c_c = -Cec-Cac+Lc(t);

    c_w = -Wdu+Wwshp+Wac+Lw(t);

    C_H = compare([inf(c_h),sup(c_h),0,0],2);
    C_C = compare([inf(c_c),sup(c_c),0,0],2);
    C_W = compare([inf(c_w),sup(c_w),0,0],2);
    Con = C_H + C_C + C_W;  

else
    if t-1==0                                                              
        V_h(t)=E_H;
    else
        V_h(t)=V_h(t-1);
    end
    P_ele = 0;
    P_waste = 0;
    P_hh(t)=V_h(t)*w_h_e*33;
    P_h(t) = infsup(round(P_hh(t).inf),round(P_hh(t).sup));

    c_e = -P_cha(t)-P_h(t);

    c_h = -Hwshp-Heb+AC(t)+Lh(t);

    c_c = -Cec-Cac+Lc(t);

    c_w = -Wdu+Wwshp+Wac+Lw(t);

    C_E = compare([inf(c_e),sup(c_e),0,0],2);
    C_H = compare([inf(c_h),sup(c_h),0,0],2);
    C_C = compare([inf(c_c),sup(c_c),0,0],2);
    C_W = compare([inf(c_w),sup(c_w),0,0],2);
    Con = C_E + C_H + C_C + C_W;
end

    f1 = Nw8(t)*150+Nph5(t)*120+Nwa9(t)*90;
    f2 = Heb*0.018+Cec*0.017+Cac*0.016+Hwshp*0.014+Wdu*0.013+V_h(t)*0.015+P_ele*0.020;
    f3 = P_waste*60;
    y1 = y1 + f1 + f2 + f3;
    y2 = y2-(Nw8(t)*Pw8(t)+Nph5(t)*Pph5(t)+Nwa9(t)*Pwa9(t));
 end
        
        f(1) = inf(y1);
        f(2) = sup(y1);
        f(3) = inf(y2);
        f(4) = sup(y2);        
        
        f(5) = Con(1);
        f(6) = Con(2);
end
